<rss version="2.0" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
    <channel>
        <title>Global Internet Business Solutions ~ GIBS</title> 
        <link>https://gibs.com</link> 
        <description>RSS feeds for Global Internet Business Solutions ~ GIBS</description> 
        <ttl>60</ttl> <item>
    <comments>https://gibs.com/Support/Knowledge-Base/ID/11/SQL_Function_to_Lookup_DNN_Profile_Values#Comments</comments> 
    <slash:comments>0</slash:comments> 
    <wfw:commentRss>https://gibs.com/DesktopModules/DnnForge%20-%20NewsArticles/RssComments.aspx?TabID=51&amp;ModuleID=411&amp;ArticleID=11</wfw:commentRss> 
    <trackback:ping>https://gibs.com:443/DesktopModules/DnnForge%20-%20NewsArticles/Tracking/Trackback.aspx?ArticleID=11&amp;PortalID=0&amp;TabID=51</trackback:ping> 
    <title>SQL Function to Lookup DNN Profile Values</title> 
    <link>https://gibs.com/Support/Knowledge-Base/ID/11/SQL_Function_to_Lookup_DNN_Profile_Values</link> 
    <description>
CREATE FUNCTION GIBS_GetProfileElement
(
@userID as int,
@portalID as int,
@ProfilePropertyName as nvarchar(100)
)
 RETURNS nvarchar(4000) AS
BEGIN

  -- If input is invalid, return null.
  IF  @ProfilePropertyName IS NULL
      OR LEN(@ProfilePropertyName) = 0
      OR @userID IS NULL
      OR @userID &lt; 1
   RETURN NULL

   DECLARE @PropertyValue AS NVARCHAR(400)
   SET @PropertyValue =
      (
       SELECT UserProfile.PropertyValue
 FROM (Users INNER JOIN UserProfile ON Users.UserID = UserProfile.UserID) INNER JOIN ProfilePropertyDefinition ON UserProfile.PropertyDefinitionID = ProfilePropertyDefinition.PropertyDefinitionID
 WHERE (((Users.UserID)=@userID) AND ((ProfilePropertyDefinition.PropertyName)=@ProfilePropertyName) AND ProfilePropertyDefinition.PortalID = @portalID)
      )
   RETURN @PropertyValue

END

</description> 
    <dc:creator></dc:creator> 
    <pubDate>Mon, 01 Feb 2021 20:20:00 GMT</pubDate> 
    <guid isPermaLink="false">f1397696-738c-4295-afcd-943feb885714:11</guid> 
    
</item>
<item>
    <comments>https://gibs.com/Support/Knowledge-Base/ID/78/Pivot_Query_for_Ventrian_Property_Agent#Comments</comments> 
    <slash:comments>0</slash:comments> 
    <wfw:commentRss>https://gibs.com/DesktopModules/DnnForge%20-%20NewsArticles/RssComments.aspx?TabID=51&amp;ModuleID=411&amp;ArticleID=78</wfw:commentRss> 
    <trackback:ping>https://gibs.com:443/DesktopModules/DnnForge%20-%20NewsArticles/Tracking/Trackback.aspx?ArticleID=78&amp;PortalID=0&amp;TabID=51</trackback:ping> 
    <title>Pivot Query for Ventrian Property Agent</title> 
    <link>https://gibs.com/Support/Knowledge-Base/ID/78/Pivot_Query_for_Ventrian_Property_Agent</link> 
    <description>I had a need for getting a property details for a SSR report and came up with the following store procedure&amp;nbsp; . . . I thought it might be useful to someone.
/****** Object: StoredProcedure [dbo].[GIBS_Rentals_Get_PropertyDetails] Script Date: 12/15/2014 06:52:03 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
&amp;nbsp;
CREATE PROCEDURE [dbo].[GIBS_Rentals_Get_PropertyDetails] 
( 
 @PropertyID int
)
AS
BEGIN
SET NOCOUNT ON;
DECLARE @cols AS VARCHAR(MAX),
 @query AS VARCHAR(MAX),
 @PropertyIDVarchar AS VARCHAR(10)
Set @PropertyIDVarchar = Convert(VARCHAR(10),@PropertyID)
select @cols = STUFF((SELECT distinct &#39;,&#39; + QUOTENAME(name) 
FROM Ventrian_PropertyAgent_CustomField 
FOR XML PATH(&#39;&#39;), TYPE
).value(&#39;.&#39;, &#39;VARCHAR(MAX)&#39;) 
,1,1,&#39;&#39;)
--print @cols
set @query 
= &#39;SELECT PropertyID,&#39; + @cols + &#39; from 
(
SELECT
PropertyID ,
&amp;nbsp;
cast(Ventrian_PropertyAgent_PropertyValue.CustomValue as Varchar(50)) AS CustomValue,
Ventrian_PropertyAgent_CustomField.Name AS [Name]
&amp;nbsp;
FROM Ventrian_PropertyAgent_PropertyValue
INNER JOIN
Ventrian_PropertyAgent_CustomField ON Ventrian_PropertyAgent_PropertyValue.CustomFieldID = Ventrian_PropertyAgent_CustomField.CustomFieldID
&amp;nbsp;
WHERE Ventrian_PropertyAgent_PropertyValue.PropertyID = &#39; + @PropertyIDVarchar + &#39;
) x
pivot
(
min(CustomValue)
 for Name in (&#39; + @cols + &#39;)
) p &#39;
--print @query
execute(@query)
END</description> 
    <dc:creator></dc:creator> 
    <pubDate>Mon, 15 Dec 2014 13:22:00 GMT</pubDate> 
    <guid isPermaLink="false">f1397696-738c-4295-afcd-943feb885714:78</guid> 
    
</item>
<item>
    <comments>https://gibs.com/Support/Knowledge-Base/ID/88/Replace_Null_or_Empty_Value_with_String#Comments</comments> 
    <slash:comments>0</slash:comments> 
    <wfw:commentRss>https://gibs.com/DesktopModules/DnnForge%20-%20NewsArticles/RssComments.aspx?TabID=51&amp;ModuleID=411&amp;ArticleID=88</wfw:commentRss> 
    <trackback:ping>https://gibs.com:443/DesktopModules/DnnForge%20-%20NewsArticles/Tracking/Trackback.aspx?ArticleID=88&amp;PortalID=0&amp;TabID=51</trackback:ping> 
    <title>Replace Null or Empty Value with String</title> 
    <link>https://gibs.com/Support/Knowledge-Base/ID/88/Replace_Null_or_Empty_Value_with_String</link> 
    <description>Select ISNULL(NULLIF(GIBS_FBLineItems.ReportType, &#39;&#39;), &#39;--Undefined--&#39;) as ReportType from GIBS_FBLineItems</description> 
    <dc:creator></dc:creator> 
    <pubDate>Tue, 16 Sep 2014 10:28:00 GMT</pubDate> 
    <guid isPermaLink="false">f1397696-738c-4295-afcd-943feb885714:88</guid> 
    
</item>
<item>
    <comments>https://gibs.com/Support/Knowledge-Base/ID/152/Finding_the_Port_of_MS_SQL_Named_Instance#Comments</comments> 
    <slash:comments>0</slash:comments> 
    <wfw:commentRss>https://gibs.com/DesktopModules/DnnForge%20-%20NewsArticles/RssComments.aspx?TabID=51&amp;ModuleID=411&amp;ArticleID=152</wfw:commentRss> 
    <trackback:ping>https://gibs.com:443/DesktopModules/DnnForge%20-%20NewsArticles/Tracking/Trackback.aspx?ArticleID=152&amp;PortalID=0&amp;TabID=51</trackback:ping> 
    <title>Finding the Port of MS SQL Named Instance</title> 
    <link>https://gibs.com/Support/Knowledge-Base/ID/152/Finding_the_Port_of_MS_SQL_Named_Instance</link> 
    <description>When running a named instance of MS&amp;#160;SQL the instance will run on a port other than the usual port&amp;#160;1433. To determine the port you can use the following query:

DECLARE @tcp_port nvarchar(5)
EXEC xp_regread
@rootkey&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160; &#39;HKEY_LOCAL_MACHINE&#39;,
@key&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160; &#39;SOFTWARE\MICROSOFT\Microsoft SQL Server\MSSQL\MSSQLSERVER\SUPERSOCKETNETLIB\TCP&#39;,
@value_name&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160; &#39;TcpPort&#39;,
@value&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160; @tcp_port OUTPUT
select @tcp_port

In my case the instance was named &quot;MSSQL&quot;.</description> 
    <dc:creator></dc:creator> 
    <pubDate>Thu, 17 Mar 2011 10:12:00 GMT</pubDate> 
    <guid isPermaLink="false">f1397696-738c-4295-afcd-943feb885714:152</guid> 
    
</item>
<item>
    <comments>https://gibs.com/Support/Knowledge-Base/ID/252/Deleting_a_DNN_User_Account#Comments</comments> 
    <slash:comments>0</slash:comments> 
    <wfw:commentRss>https://gibs.com/DesktopModules/DnnForge%20-%20NewsArticles/RssComments.aspx?TabID=51&amp;ModuleID=411&amp;ArticleID=252</wfw:commentRss> 
    <trackback:ping>https://gibs.com:443/DesktopModules/DnnForge%20-%20NewsArticles/Tracking/Trackback.aspx?ArticleID=252&amp;PortalID=0&amp;TabID=51</trackback:ping> 
    <title>Deleting a DNN User Account</title> 
    <link>https://gibs.com/Support/Knowledge-Base/ID/252/Deleting_a_DNN_User_Account</link> 
    <description>
&amp;#160;
@rUser table (UserId int) &#39;Set UserID&#39; into @rUser (UserId) values (9) 
Print
&#39;==================================&#39;
Print
&#39;DELETE from aspnet_Membership&#39;
DELETE
from aspnet_Membership where UserId in (SELECT au.UserId from aspnet_Users au join users u on au.username = u.username where u.userid in (select * from @rUser) ) 
Print
&#39;==================================&#39;
Print
&#39;DELETE from aspnet_Users&#39;
DELETE
from aspnet_Users where UserId in (SELECT au.UserId from aspnet_Users au join users u on au.username = u.username where u.userid in (select * from @rUser) ) 
-- clear profile properties

Print
&#39;==================================&#39;
Print
&#39;DELETE from UserProfile&#39;
DELETE
&amp;#160;
FROM UserProfile where UserID in (SELECT UserId from users where userid in (select * from @rUser) ) 
-- clear portal relationships with users

Print
&#39;==================================&#39;
Print
&#39;DELETE from UserPortals&#39;
DELETE
&amp;#160;
FROM UserPortals where UserID in (SELECT UserId from users where userid in (select * from @rUser) ) 
-- clear role relationships with users

Print
&#39;==================================&#39;
Print
&#39;DELETE from UserRoles&#39;
DELETE
&amp;#160;
FROM UserRoles where UserID in (SELECT UserId from users where userid in (select * from @rUser) ) 
&amp;#160;

-- finally remove core user profile info

Print
&#39;==================================&#39;
Print
&#39;DELETE from Users&#39;
DELETE
FROM users where userid in (select * from @rUser)
&amp;#160;
&amp;#160;
Print
&amp;#160;
-- WAIT WAIT WAIT WAIT - remember to put in the right userid

insert
&amp;#160;

declare</description> 
    <dc:creator></dc:creator> 
    <pubDate>Wed, 27 Oct 2010 18:32:00 GMT</pubDate> 
    <guid isPermaLink="false">f1397696-738c-4295-afcd-943feb885714:252</guid> 
    
</item>
<item>
    <comments>https://gibs.com/Support/Knowledge-Base/ID/307/Check_for_Null_Value_in_a_Stored_Procedure#Comments</comments> 
    <slash:comments>0</slash:comments> 
    <wfw:commentRss>https://gibs.com/DesktopModules/DnnForge%20-%20NewsArticles/RssComments.aspx?TabID=51&amp;ModuleID=411&amp;ArticleID=307</wfw:commentRss> 
    <trackback:ping>https://gibs.com:443/DesktopModules/DnnForge%20-%20NewsArticles/Tracking/Trackback.aspx?ArticleID=307&amp;PortalID=0&amp;TabID=51</trackback:ping> 
    <title>Check for Null Value in a Stored Procedure</title> 
    <link>https://gibs.com/Support/Knowledge-Base/ID/307/Check_for_Null_Value_in_a_Stored_Procedure</link> 
    <description>Within a stored procedure use an IF&amp;#160;STATEMENT to check a parameter for a NULL VALUE
if( @CustomFieldID is null)
begin 
&amp;#160; &amp;#160;print &#39;NULL VALUE - SKIP IT&#39;
end
else
begin
&amp;#160;print &#39;PARAMETER&amp;#160;HAS&amp;#160;VALUE&#39;
end</description> 
    <dc:creator></dc:creator> 
    <pubDate>Wed, 21 Apr 2010 08:54:00 GMT</pubDate> 
    <guid isPermaLink="false">f1397696-738c-4295-afcd-943feb885714:307</guid> 
    
</item>

    </channel>
</rss>